package com.yxzr.youyou.retrofit;




import java.util.HashMap;
import java.util.List;
import java.util.Map;

import io.reactivex.Flowable;
import io.reactivex.Observable;
import okhttp3.MultipartBody;
import okhttp3.RequestBody;
import okhttp3.ResponseBody;
import retrofit2.http.Field;
import retrofit2.http.FieldMap;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;
import retrofit2.http.PartMap;
import retrofit2.http.Streaming;
import retrofit2.http.Url;

/**
 * Created by 18354 on 2018-04-08.
 */

public interface RetrofitService {

    //首页标题分类
    @FormUrlEncoded
    @POST("api/Index/classify")
    Observable<ResponseBody> homeTitle(@Field("is_vip") String is_vip);

    //发送验证码
    @FormUrlEncoded
    @POST("api/login/sendCode")
    Observable<ResponseBody> sendCode(@Field("user_phone") String user_phone,@Field("type") String type);

    //注册
    @FormUrlEncoded
    @POST("api/login/register")
    Observable<ResponseBody> register(@Field("user_phone") String user_phone, @Field("password") String password,
                                      @Field("parent_code") String parent_code, @Field("code") String code,
                                          @Field("username") String username, @Field("repassword") String repassword);

    //登陆
    @FormUrlEncoded
    @POST("api/login/login")
    Observable<ResponseBody> login(@Field("user_phone") String user_phone, @Field("password") String password);

    //忘记密码
    @FormUrlEncoded
    @POST("api/Login/forgotPassword")
    Observable<ResponseBody> forgetPwd(@Field("user_phone") String user_phone, @Field("code") String code,
                                       @Field("is_password") String is_password, @Field("user_password") String user_password);

    //修改密码
    @FormUrlEncoded
    @POST("api/UsersApi/editPassword")
    Observable<ResponseBody> editPassword(@Field("token") String token, @Field("id") String id,
                                       @Field("password") String password, @Field("code") String code);

    //电影电视剧
    @FormUrlEncoded
    @POST("api/Index/movie")
    Observable<ResponseBody> movie(@Field("is_vip") String is_vip,@Field("type") String type);

    //动漫 资讯综艺 时间地区语言 分类
    @FormUrlEncoded
    @POST("api/Index/dzz")
    Observable<ResponseBody> homeType(@Field("type") String type);

    //点击二级菜单后---时间地区语言
    @FormUrlEncoded
    @POST("api/Index/mtwo_serch")
    Observable<ResponseBody> movieSearch(@Field("is_vip") String is_vip,@Field("id") String id,@Field("area") String area,
            @Field("language") String language,@Field("year") String year,@Field("type") String type,@Field("pid") String pid);

    //影片详情
    @FormUrlEncoded
    @POST("api/Index/movie_details")
    Observable<ResponseBody> movieDetail(@Field("id") String id);


    //  电影 点击二级分类
    @FormUrlEncoded
    @POST("api/Index/movie_click")
    Observable<ResponseBody> movieClick(@Field("type") String type);

    //查询 个人资料
    @FormUrlEncoded
    @POST("api/Personal/userInfor")
    Observable<ResponseBody> getUserInfo(@Field("token") String token);

    //修改头像
    @Multipart
    @POST("api/UsersApi/uploadHead")
    Observable<ResponseBody> updateImage(@PartMap Map<String, RequestBody> map, @Part List<MultipartBody.Part> parts);


    //修改资料
    @FormUrlEncoded
    @POST("api/UsersApi/profile")
    Observable<ResponseBody> updateData(@Field("token") String token,@Field("id") String id,@Field("email") String email,
                                        @Field("birthday") String birthday,@Field("gender") String gender,@Field("introduction") String introduction);

    //签到积分
    @FormUrlEncoded
    @POST("api/Personal/recom")
    Observable<ResponseBody> sign(@Field("token") String token);

    //充值卡
    @FormUrlEncoded
    @POST("api/Personal/card")
    Observable<ResponseBody> rechargeCard(@Field("token") String token,@Field("key") String key);

    //添加收藏
    @FormUrlEncoded
    @POST("api/Personal/favorites_add")
    Observable<ResponseBody> favorites_add(@Field("token") String token,@Field("movie_id") String movie_id);

    //取消收藏
    @FormUrlEncoded
    @POST("api/Personal/favorites_no")
    Observable<ResponseBody> favorites_no(@Field("token") String token,@Field("movie_id") String movie_id);

    //顶 踩
    @FormUrlEncoded
    @POST("api/Personal/up")
    Observable<ResponseBody> up(@Field("token") String token,@Field("type") String type,@Field("movie_id") String movie_id);

    //是否收藏过
    @FormUrlEncoded
    @POST("api/Personal/is_favorites")
    Observable<ResponseBody> is_favorites(@Field("token") String token,@Field("movie_id") String movie_id);

    //是否顶、踩过
    @FormUrlEncoded
    @POST("api/Personal/is_up")
    Observable<ResponseBody> is_up(@Field("token") String token,@Field("movie_id") String movie_id);

    //添加播放记录
    @FormUrlEncoded
    @POST("api/Index/add_bofang")
    Observable<ResponseBody> add_bofang(@Field("token") String token,@Field("movie_id") String movie_id);

    //我的收藏
    @FormUrlEncoded
    @POST("api/Personal/favorites")
    Observable<ResponseBody> favorites(@Field("token") String token);

    //删除收藏
    @FormUrlEncoded
    @POST("api/Personal/favorites_remove")
    Observable<ResponseBody> favorites_remove(@Field("token") String token,@Field("id") String id);

    //充值记录
    @FormUrlEncoded
    @POST("api/Personal/record_pay")
    Observable<ResponseBody> record_pay(@Field("token") String token,@Field("page") String page,@Field("page_list") String page_list);

    //用户消息
    @FormUrlEncoded
    @POST("api/Personal/messeage")
    Observable<ResponseBody> messeage(@Field("token") String token,@Field("type") String type,
                                      @Field("page") String page,@Field("page_list") String page_list);

    //播放记录
    @FormUrlEncoded
    @POST("api/Personal/playback_record")
    Observable<ResponseBody> playback_record(@Field("token") String token);

    //删除播放记录
    @FormUrlEncoded
    @POST("api/Personal/remove")
    Observable<ResponseBody> remove(@Field("token") String token,@Field("movie_id") String movie_id);

    //查询视频评论
    @FormUrlEncoded
    @POST("api/Index/select_comment")
    Observable<ResponseBody> getCommentList(@Field("token") String token,@Field("mid") String mid,@Field("page") String page);

    //添加视频评论
    @FormUrlEncoded
    @POST("api/Index/add_comment")
    Observable<ResponseBody> addComment(@Field("token") String token,@Field("uid") String uid,@Field("content") String content
            ,@Field("mid") String mid);

    //求片列表
    @FormUrlEncoded
    @POST("api/Personal/leaving_list")
    Observable<ResponseBody> leavingList(@Field("token") String token,@Field("page") String page,@Field("page_list") String page_list);

    //添加求片
    @FormUrlEncoded
    @POST("api/Personal/leaving_meseage")
    Observable<ResponseBody> addLeavingMessage(@Field("token") String token,@Field("content") String content);

    //热门搜索
    @GET("api/Index/hots")
    Observable<ResponseBody> hotSearch();

    //删除播放记录
    @FormUrlEncoded
    @POST("api/Personal/search")
    Observable<ResponseBody> search(@Field("token") String token,@Field("movie_name") String movie_name);

    //积分商城
    @FormUrlEncoded
    @POST("api/Personal/shop")
    Observable<ResponseBody> shop(@Field("token") String token);

    //开始对换
    @FormUrlEncoded
    @POST("api/Personal/exchange")
    Observable<ResponseBody> exchange(@Field("token") String token,@Field("id") String id,@Field("num") String num);

    //对换记录
    @FormUrlEncoded
    @POST("api/Personal/exchange_record")
    Observable<ResponseBody> exchange_record(@Field("token") String token,@Field("page") String page,@Field("page_list") String page_list);

    //充值数据列表
    @GET("api/Personal/recharge")
    Observable<ResponseBody> recharge();

    //版本更新下载app
    @Streaming
    @GET
    Flowable<ResponseBody> downLoadApk(@Url String url);
}
